using OrdersManager.Module.BusinessEntities;
using OrdersManager.Module.Views;

namespace OrdersManager.Module.Tests.Mocks
{
	public class MockOrderView : IOrderView
	{
        private Order _order;
        private bool _newOrderCalled;
        private bool _editOrderCalled;
        private bool _saveButtonEnabled;
        private bool _processButtonEnabled;
        private bool _shipButtonEnabled;
        private bool _cancelButtonEnabled;
        private bool _orderFieldsEnabled;

        public Order Order
        {
            get 
            { 
                return _order; 
            }
            set 
            { 
                _order = value; 
            }
        }

        public bool NewOrderCalled
        {
            get 
            { 
                return _newOrderCalled; 
            }
            set 
            { 
                _newOrderCalled = value; 
            }
        }

        public bool EditOrderCalled
        {
            get
            {
                return _editOrderCalled;
            }
            set
            {
                _editOrderCalled = value;
            }
        }

        public bool SaveButtonEnabled
        {
            get
            {
                return _saveButtonEnabled;
            }
            set
            {
                _saveButtonEnabled = value;
            }
        }

        public bool ProcessButtonEnabled
        {
            get
            {
                return _processButtonEnabled;
            }
            set
            {
                _processButtonEnabled = value;
            }
        }

        public bool ShipButtonEnabled
        {
            get
            {
                return _shipButtonEnabled;
            }
            set
            {
                _shipButtonEnabled = value;
            }
        }

        public bool CancelButtonEnabled
        {
            get
            {
                return _cancelButtonEnabled;
            }
            set
            {
                _cancelButtonEnabled = value;
            }
        }        

		public void NewOrder(Order order)
		{
			Order = order;
			NewOrderCalled = true;
        }

		public void EditOrder(Order order)
		{
			Order = order;
			EditOrderCalled = true;
        }


        #region IOrderView Members


        public bool OrderFieldsEnabled
        {
            get
            {
                return _orderFieldsEnabled;
            }
            set
            {
                _orderFieldsEnabled = value;
            }
        }

        #endregion
    }

}